//
//  LSZMVSongCollectionViewCell+LCUpdateConstraints.m
//  JKFuYinProject
//
//  Created by admin on 2018/9/27.
//  Copyright © 2018 LC. All rights reserved.
//

#import "LSZMVSongCollectionViewCell+LCUpdateConstraints.h"

@implementation LSZMVSongCollectionViewCell (LCUpdateConstraints)

- (void)lcSetupConstraints{
//    self.backgroundColor = arc4random_color;//调用随机色

    [self.imageViewCover sizeToFit];
    [self.imageViewCover mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(0);
        make.left.equalTo(self.contentView.mas_left).offset(0);
        make.right.equalTo(self.contentView.mas_right).offset(0);
        make.height.mas_equalTo(self.contentView.frame.size.width*9/16);
    }];
    
    ///点击量
    [self.labelHits mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(2);
        make.right.equalTo(self.contentView.mas_right).offset(-5);
        make.height.equalTo(self.labelHits.mas_height);
    }];
    ///点击量的耳机图标
    [self.imageViewHits mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.labelHits.mas_centerY);
        make.height.mas_equalTo(self.imageViewHits.height);
        make.width.mas_equalTo(self.imageViewHits.height);
        make.right.equalTo(self.labelHits.mas_left).offset(-5);
    }];

    [self.imageViewPlay mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.imageViewCover);
    }];
//    [self.labelTime debug:arc4random_color width:1];
    [self.labelTime mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.labelHits.mas_right).offset(0);
        make.bottom.equalTo(self.imageViewCover.mas_bottom).offset(0);
        make.height.equalTo(self.labelTime.mas_height);
    }];
//    [self.albumHaveSongsNum debug:arc4random_color width:1];
    [self.albumHaveSongsNum mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(5);
        make.bottom.equalTo(self.imageViewCover.mas_bottom).offset(-5);
        make.height.equalTo(self.labelTime.mas_height);
    }];
    [self.imageViewTimePlayer mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.labelTime.mas_left).offset(-3);
        make.bottom.equalTo(self.labelTime.mas_bottom).offset(-3);
        make.height.mas_equalTo(10);
        make.width.mas_equalTo(10);
    }];

    [self.imageViewRightPlay mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.imageViewCover.mas_bottom).offset(-5);
        make.right.equalTo(self.labelTime.mas_right).offset(0);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(20);
    }];
    
//    [self.labelTitle debug:arc4random_color width:1];
    [self.labelTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imageViewCover.mas_bottom).offset(10);
        make.left.equalTo(self.contentView.mas_left).offset(5);
        make.right.equalTo(self.contentView.mas_right).offset(-10);
    }];
//    [self.labelNote debug:arc4random_color width:1];
    [self.labelNote mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labelTitle.mas_bottom).offset(5);
        make.left.equalTo(self.contentView.mas_left).offset(5);
        make.right.equalTo(self.contentView.mas_right).offset(-10);
    }];
    
}

@end
